﻿namespace BassettData.Robots
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    /// <summary>
    /// Represents a location in the Robot world.
    /// </summary>
    public struct Location
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="Location"/> struct.
        /// </summary>
        /// <param name="avenue">The avenue.</param>
        /// <param name="street">The street.</param>
        public Location(int avenue, int street)
            : this()
        {
            this.Avenue = avenue;
            this.Street = street;
        }

        /// <summary>
        /// Gets the bottom left location, i.e. avenue 1, street 1.
        /// </summary>
        /// <value>The bottom left location.</value>
        public static Location BottomLeft
        {
            get
            {
                return new Location(1, 1);
            }
        }

        /// <summary>
        /// Gets the avenue (or Y-coordinate).
        /// </summary>
        /// <value>The avenue.</value>
        public int Avenue { get; private set; }

        /// <summary>
        /// Gets the street (or X-coordinate).
        /// </summary>
        /// <value>The street.</value>
        public int Street { get; private set; }

        /// <summary>
        /// Formats the location in a human-readable form.
        /// </summary>
        /// <returns>
        /// A <see cref="System.String"/> that represents this instance.
        /// </returns>
        public override string ToString()
        {
            return string.Format("Avenue {0}, Street {1}", Avenue, Street);
        }
    }
}
